<template>
  <div class="search">
    <el-autocomplete
        v-model="hosname"
        :fetch-suggestions="fetchData"
        :trigger-on-focus="false"
        clearable
        placeholder="请输入医院名称"
    />
    <el-button class="search-btn" type="primary" size="default" :icon="Search">搜索</el-button>
  </div>
</template>

<script setup lang="ts">
import { Search } from '@element-plus/icons-vue'
import { ref } from 'vue';
import type { HospitalInfo, Content } from '@/api/home/type';
import { reqHospitalInfo } from '@/api/home';

let hosname =ref<string>('');

const fetchData = (keyword:string, cb:any) => {
  const results = keyword
}

</script>

<style scoped lang="scss">
.search{
    width: 100%;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0px;

    :deep(.el-autocomplete) {
        width: 600px;
        margin-right: 10px;
    }
    
    .search-btn {
    width: 100px;
    }
}
</style>